Fix resource leak in gdk_display_close() under Wayland
authorJulien Ropé <jrope@redhat.com>
Mon, 31 Aug 2020 15:26:18 +0000 (17:26 +0200)
committerJulien Ropé <jrope@redhat.com>
Mon, 31 Aug 2020 15:46:18 +0000 (17:46 +0200)
When using the gdk_display_close(), the handle to the Wayland compositor was not released. This could cause the consumption of all available handles, preventing other processes from accessing the display.

Fixing this by calling wl_display_disconnect() when releasing the GdkWaylandDisplay object.

Signed-off-by: Julien Ropé <jrope@redhat.com>
gdk/wayland/gdkdisplay-wayland.c

index 9be0bacfadc6d3269773c12f2873059f9abbe165..035eec5819ceeba7b3b0c282a03e6513e2678a1c 100644 (file)
@@ -755,6 +755,8 @@ gdk_wayland_display_finalize (GObject *object)
 
   g_clear_object (&display_wayland->settings_portal);
 
+  wl_display_disconnect (display_wayland->wl_display);
+
   G_OBJECT_CLASS (gdk_wayland_display_parent_class)->finalize (object);
 }